/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
 * MA  02110-1301, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */

package com.aionemu.gameserver.model.templates.npcTemplate;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

import com.aionemu.gameserver.model.Race;
import com.aionemu.gameserver.model.TribeClass;

/**
 * @author Mr. Poke
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "NpcCommonData")
public class NpcCommonData
{

	@XmlAttribute
	protected List<Integer>	equipment;
	@XmlAttribute(name = "equipment_mask")
	protected Short			equipmentMask;
	@XmlAttribute(name = "name_id", required = true)
	protected int			nameId;
	@XmlAttribute(name = "title_id")
	protected Integer		titleId;
	@XmlAttribute
	protected TribeClass		tribe;
	@XmlAttribute
	protected Race			race;
	@XmlAttribute
	protected NpcRank		rank;
	@XmlAttribute
	protected NpcRating		rating;
	@XmlAttribute(name = "game_lang")
	protected GameLang		gameLang;

	/**
	 * Gets the value of the equipment property.
	 * 
	 * <p>
	 * This accessor method returns a reference to the live list,
	 * not a snapshot. Therefore any modification you make to the
	 * returned list will be present inside the JAXB object.
	 * This is why there is not a <CODE>set</CODE> method for the equipment property.
	 * 
	 * <p>
	 * For example, to add a new item, do as follows:
	 * <pre>
	 *    getEquipment().add(newItem);
	 * </pre>
	 * 
	 * 
	 * <p>
	 * Objects of the following type(s) are allowed in the list
	 * {@link Integer }
	 * 
	 * 
	 */
	public List<Integer> getEquipment()
	{
		if (equipment == null)
		{
			equipment = new ArrayList<Integer>();
		}
		return this.equipment;
	}

	/**
	 * Gets the value of the equipmentMask property.
	 * 
	 * @return
	 *     possible object is
	 *     {@link Short }
	 *     
	 */
	public short getEquipmentMask()
	{
		if (equipmentMask == null)
		{
			return ((short) 0);
		}
		else
		{
			return equipmentMask;
		}
	}

	/**
	 * Sets the value of the equipmentMask property.
	 * 
	 * @param value
	 *     allowed object is
	 *     {@link Short }
	 *     
	 */
	public void setEquipmentMask(Short value)
	{
		this.equipmentMask = value;
	}

	/**
	 * Gets the value of the nameId property.
	 * 
	 */
	public int getNameId()
	{
		return nameId;
	}

	/**
	 * Gets the value of the titleId property.
	 * 
	 * @return
	 *     possible object is
	 *     {@link Integer }
	 *     
	 */
	public int getTitleId()
	{
		if (titleId == null)
		{
			return 0;
		}
		else
		{
			return titleId;
		}
	}

	/**
	 * Gets the value of the tribe property.
	 * 
	 * @return
	 *     possible object is
	 *     {@link TribeClass }
	 *     
	 */
	public TribeClass getTribe()
	{
		return tribe;
	}

	/**
	 * Gets the value of the race property.
	 * 
	 * @return
	 *     possible object is
	 *     {@link Race }
	 *     
	 */
	public Race getRace()
	{
		return race;
	}

	/**
	 * Gets the value of the rank property.
	 * 
	 * @return
	 *     possible object is
	 *     {@link NpcRank }
	 *     
	 */
	public NpcRank getRank()
	{
		return rank;
	}

	/**
	 * Gets the value of the rating property.
	 * 
	 * @return
	 *     possible object is
	 *     {@link NpcRating }
	 *     
	 */
	public NpcRating getRating()
	{
		return rating;
	}

	/**
	 * Gets the value of the gameLang property.
	 * 
	 * @return
	 *     possible object is
	 *     {@link GameLang }
	 *     
	 */
	public GameLang getGameLang()
	{
		return gameLang;
	}
}
